'use strict'
const Datastore = require('nedb')
const SUN = require('../base/sun')
let serverConfig = SUN.serConfig.serverConfig

let db = {}
let src = process.cwd()
let path = require('path')
let gameDataPath = path.resolve(src, '../gameData')
db.ids = new Datastore(path.resolve(gameDataPath, 'ids.db'))
db.users = new Datastore(path.resolve(gameDataPath, 'users.db'))
db.players = new Datastore(path.resolve(gameDataPath, 'players.db'))
db.ids.loadDatabase()
db.users.loadDatabase()
db.players.loadDatabase()
module.exports = db
